package org.smarthings.things.management.rest.resources.properties;

import java.net.URI;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

import org.smarthings.things.commons.rest.BasicIdentifiableResource;

@XmlType(name = "thingProperty")
@XmlRootElement(name = "thingProperty")
public class ThingPropertyResource extends BasicIdentifiableResource {

	private String type;
	private String value;
	// private Element value;
	private URI subscribe;
	private URI metadata;

	@XmlElement(name = "type", required = false)
	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	@XmlElement(name = "value", required = false)
	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	// @XmlAnyElement(lax = true) FIXME ugly jersey does not work!
	// @XmlJavaTypeAdapter(XmlAnyElementAdapter.class)
	// public Element getValue() {
	// return value;
	// }
	//
	// public void setValue(Element value) {
	// this.value = value;
	// }

	@XmlElement(name = "subscribe", required = false)
	public URI getSubscribe() {
		return subscribe;
	}

	public void setSubscribe(URI subscribe) {
		this.subscribe = subscribe;
	}

	@XmlElement(name = "metadata", required = false)
	public URI getMetadata() {
		return metadata;
	}

	public void setMetadata(URI metadata) {
		this.metadata = metadata;
	}

}
